let Dashboard = () => import("../views/dashboard.vue")
// let Users = () => import("../views/Users.vue");
let Error = () => import("../views/Error.vue");
let Layout = () => import("../components/Layout.vue");
let Login = () => import("../views/login.vue");
// let Regirest = () => import("../views/SignIn/Regirest.vue");

let routes = [
    {
        path: "/",
        name: "Layout",
        //   重定向到/dashboard路由·
        redirect: "dashboard",
        meta: {
            title: "根目录",
            icon: "el-icon-menu",
            hidden: true //添加隐藏
        },
        component: Layout,
        //注册子路由，用于路由嵌套
        children: [{
                path: "dashboard",
                component: Dashboard,
                meta: {
                    title: "3D地球",
                    icon: "el-icon-pie-chart"
                },


            },


        ],
    },
    {
        path: "/System",
        name: "System",
        meta: {
            title: "系统设置",
            icon: "el-icon-s-tools"
        },
        component: Layout,
        children: [{
                path: "user",
                meta: {
                    title: "用户设置",
                    icon: "el-icon-user-solid"
                },
                name: "user",
                component: () => import("../views/System/Users/Index.vue"),
                children: [{
                        path: "profile",
                        meta: {
                            title: "用户信息",

                            //只有登录才可以进入此界面
                            requireAuth: true,

                            icon: "el-icon-pie-chart"
                        },
                        component: () => import("../views/System/Users/Profile.vue")
                    },
                    {
                        path: "password",
                        meta: {
                            title: "修改密码",
                            icon: "el-icon-pie-chart"
                        },
                        component: () => import("../views/System/Users/Password.vue")
                    },
                    {
                        path: "avatar",
                        meta: {
                            title: "上传图片",
                            icon: "el-icon-pie-chart"
                        },
                        component: () => import("../views/System/Users/Avatar.vue")
                    },
                ]
            },
            {
                path: "role",
                meta: {
                    title: "角色设置",
                    icon: "el-icon-pie-chart"
                },
                component: () => import("../views/System/Roles/Profile.vue")
            },
            {
                path: "userRole",
                name: "userRole",
                meta: {
                    title: "用户角色",
                    icon: "el-icon-pie-chart"
                },
                component: () => import("../views/System/UserRoles")
            },
        ]
    },
    {
        path: "/login",
        name: "Login",
        component: Login,
        meta: {
            title: "登录",
            hidden: true
        }
    },
    {
        path: "*",
        name: "Error",
        component: Error,
        meta: {
            title: "错误"
        }
    },
]

export default routes